//
//  NewticketWebController.m
//  迷笛
//
//  Created by . on 2018/9/7.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "MIDINewticketWebController.h"
#import "MIDIchooseticketController.h"
@interface MIDINewticketWebController ()
@property(nonatomic,strong)UIButton * buy;

@end

@implementation MIDINewticketWebController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIBarButtonItem *leftBarItem = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:self action:@selector(Block:)];
    self.navigationItem.leftBarButtonItem = leftBarItem;
    
    [self.navigationItem.leftBarButtonItem setImage:[[UIImage imageNamed:@"后退"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [self HomeUI];
}





//视图将要出现时（导航颜色字体颜色）
- (void)viewWillAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden = YES;
    self.navigationController.navigationBar.translucent = NO;//Bar的模糊效果，默认为YES
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"#171717"];
    self.title = @"购票详情";
     [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#FFFFFF"],NSFontAttributeName : [UIFont fontWithName:@"Helvetica-Bold" size:WidthScale(17)]}];
    //    去掉导航黑线
    UIImage *img = [UIImage imageNamed:@""];
    [self.navigationController.navigationBar setBackgroundImage:img  forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
}
// 返回上一级
-(void)Block:(UIButton * )sender
{
    [self.navigationController popViewControllerAnimated:YES];
}
-(void)HomeUI
{
    [self.view addSubview:self.buy];
    [self.buy mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_offset(kDevice_Is_iPhoneX?HeighX(-34):HeightScale(0));
        make.centerX.equalTo(self.view);
        make.width.mas_offset(self.view.frame.size.width);
        make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(49):HeightScale(49));
    }];
}
-(UIButton *)buy
{
    if (!_buy)
    {
        _buy =[[UIButton alloc]init];
        [_buy setBackgroundColor:[UIColor colorWithHexString:@"#FF005D"]];
        _buy.titleLabel.font =[UIFont systemFontOfSize:WidthScale(15)];
        [_buy setTitle:@"立即购买" forState:UIControlStateNormal];
        [_buy setTintColor:[UIColor whiteColor]];
        [_buy addTarget:self action:@selector(Buy:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _buy;
}
-(void)Buy:(UIButton * )sender
{
    MIDIchooseticketController * choosetikcet =[[MIDIchooseticketController alloc]init];
    [self.navigationController pushViewController:choosetikcet animated:YES];
}
@end
